import request from './request'

// const base = api.rootPoint
const base = 'https://oes.shechipin1.com/api/v1'

//创建学员
const createStudent = function () {
  return request({
    url: `${base }/extend/students`,
    method: 'post'
  })
}

//获取答题试卷，带答案
const getExamPaper = function () {
  return request({
    url: `${ base }/extend/exams/paper`,
    method: 'get'
  })
}

//提交试卷
const postExamPaper = function (data = {}) {
  return request({
    url: `${ base }/extend/exams/paper`,
    method: 'post',
    data
  })
}

//获取当前学员答卷结果
const getExamResult = function (stuId) {
  return request({
    url: `${ base }/extend/exams/paper/${ stuId }`,
    method: 'get'
  })
}

//获取当前学员所有答卷
const getAllExamPaper = function (stuId) {
  return request({
    url: `${ base }/extend/exams/papers/${ stuId }`,
    method: 'get'
  })
}

const $apis = {
  createStudent,
  getExamPaper,
  postExamPaper,
  getExamResult,
  getAllExamPaper
}

export default $apis
